package com.yt.controller;

import com.yt.entity.Order;
import com.yt.service.OrderService;
import com.yt.util.CommonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Classname OrderController
 * @Description
 * @Date 2021/11/2 13:26
 * @Create by 杨涛
 */
@RestController
@Slf4j
@RefreshScope
public class OrderController {

    @Resource
    OrderService orderService;

    @RequestMapping("/order/create")
    public CommonResult create(Order order){
        log.info(order.toString());
        orderService.create(order);
        return new CommonResult(200,"订单创建成功");
    }
}
